#ifndef GLOBAL_H
#define GLOBAL_H

#include "proxypool.h"
#include "mysqlpool.h"
#include "publicstruct.h"
//#include "precomp.h"
#include "ctclientsocket.h"
//#include <QMutex>
#include "GlobalQueue.h"

extern MySqlPool g_mysqlPool;
extern QMap<QString ,QStringList > g_dnSuffixMappingWhoIs;
extern int g_undefineCategoryId;
extern ProxyPool g_proxyPool;
extern QQueue<std::unique_ptr<CTClientSocket>*> g_dnQueue;
extern QMutex   g_dnQueueMutex;
extern bool g_enableProxy;
extern int g_currentDealNum;
extern DataDict g_testProxyDest;
extern QVector<DataDict > g_dataDicts;
// class Global
// {
// public:
//    Global();
    DomainInfo g_ParseBytesToDomainInfo(QByteArray data,QString reqParam,int domainId);
    QMap<QString, QString> g_decodeWhoisInfoToMap(int dnType, QByteArray data);
    bool g_updateDomainDetailInfoById(int domainId, QString domainName, DomainInfo dnInfo);
    bool g_updateDomainDetailInfoByIdToSqlite(DomainInfo dnInfo,QSqlDatabase db);
// };

    class GlobalQueueSingleton {
    public:
        static GlobalQueue* instance() {
            static GlobalQueue* queueInstance = new GlobalQueue;
            return queueInstance;
        }
    };

#endif // GLOBAL_H

